/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
$(document).ready(function(){
	console.log('document ready');
        $.ajax({url: 'http://leoto.us/holiday/test/product.php',
            type: 'get',
             // Convert a form to a JSON string representation                     
                    async: true,
					dataType: "json",
                    beforeSend: function() {
						console.log('beforeSend');
                    },
                    complete: function() {
                    },
                    success: function (result) {
                        console.log(result);
					//	console.log(result.product_id);
						
						for (var i = 0; i < result.length; i++)
						{
							console.log(result[i].name);
							$("#output").append("<li class=\"list\">" + result[i].name + "</li>");
						}
						
						
					//	$("#output").html(result);
                    },
                    error: function (request,error) {
                        // This callback function will trigger on unsuccessful action                
                        console.log(request);
						console.log(error);
                  }
                });   

});

